import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:verse_systems/pages/mine/mine_control.dart';
import 'package:verse_systems/res/colors.dart';
import 'package:verse_systems/widgets/drawer_appbar.dart';
import 'package:verse_systems/widgets/sp_button.dart';

class MineLogOffPage extends StatefulWidget {
  const MineLogOffPage({super.key});

  @override
  State<MineLogOffPage> createState() => _MineLogOffPageState();
}

class _MineLogOffPageState extends State<MineLogOffPage> {
  final control = Get.find<MineControl>();
  final state = Get.find<MineControl>().state;

  
  @override
  void initState() {
    super.initState();
    control.getHotline();
  } 

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colours.system_background_color,
        appBar: DrawerAppbar(
          title: 'logo_off_account'.tr,
        ),
        body: SizedBox(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
          child: Stack(
            children: [
              Container(
                padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 23.w),
                margin: EdgeInsets.symmetric(
                    horizontal: (MediaQuery.of(context).size.width - 310.w) / 2,
                    vertical: 18.w),
                width: 330.w,
                height: 200.w,
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.all(Radius.circular(10.w)),
                  color: Colours.app_main_color,
                ),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      "${"warning".tr}:\n${"once_cannot_use".tr}",
                      style: TextStyle(
                          fontSize: 20.sp,
                          color: Colours.app_black_text_color,
                          fontWeight: FontWeight.w500,
                          height: 1.5),
                    ),
                    SizedBox(height: 5.w),
                    Text(
                      "once_cannot_use_account".tr,
                      style: TextStyle(
                        fontSize: 14.sp,
                        color: Colours.calendar_open_text_color,
                      ),
                    ),
                  ],
                ),
              ),
              Positioned(
                  bottom: 44.w,
                  child: Center(
                      child: Container(
                    margin: EdgeInsets.symmetric(
                        horizontal:
                            (MediaQuery.of(context).size.width - 310.w) / 2),
                    width: 310.w,
                    child: SPButton(
                        minHeight: 50.w,
                        fontSize: 18.sp,
                        text: "warning_risks".tr,
                        textColor: Colours.app_main_color,
                        backgroundColor: Colours.app_main_background_color,
                        radius: 25.w,
                        onPressed: () {
                          control.onTapCard(5);
                        }),
                  ))),
            ],
          ),
        ));
  }
}
